/**
 * 分页读取配置
 */
package com.mavenq.fly.utils.excelv4.config;

public class PageReadConfig {
    private int pageSize = 1000;
    private int maxRows = 10000;
    private boolean readInBackground = false;
    private int batchProcessSize = 500;
    
    public static PageReadConfig create() {
        return new PageReadConfig();
    }
    
    public PageReadConfig pageSize(int pageSize) {
        this.pageSize = Math.max(1, pageSize);
        return this;
    }
    
    public PageReadConfig maxRows(int maxRows) {
        this.maxRows = Math.max(1, maxRows);
        return this;
    }
    
    public PageReadConfig readInBackground(boolean readInBackground) {
        this.readInBackground = readInBackground;
        return this;
    }
    
    public PageReadConfig batchProcessSize(int batchProcessSize) {
        this.batchProcessSize = Math.max(1, batchProcessSize);
        return this;
    }
    
    public int getPageSize() { return pageSize; }
    public int getMaxRows() { return maxRows; }
    public boolean isReadInBackground() { return readInBackground; }
    public int getBatchProcessSize() { return batchProcessSize; }
}
